<jsp:directive.page	import="org.biojava.dasobert.dasregistry.DasCoordinateSystem" />
<jsp:directive.page import="org.biojava.services.das.registry.DasRegistrySql"/>
<jsp:directive.page import="org.biojava.dasobert.dasregistry.DasCoordSysComparator"/>
<jsp:directive.page import="java.util.Comparator"/>
<jsp:directive.page import="java.util.List"/>
<jsp:directive.page import="org.springframework.beans.factory.BeanFactory"/>
<jsp:directive.page import="org.springframework.context.support.ClassPathXmlApplicationContext"/>
<% 
   BeanFactory ctx=(new ClassPathXmlApplicationContext("SpringDAO.xml"));
		DasRegistrySql registry=(DasRegistrySql)ctx.getBean("registryBean");
%>



<%@ include file="sangertablestart.jsp" %>
<tr id="row0">
	  <td><b>authority (+version)</b></td>
	  <td><b>type</b></td>
	  <td><b>organism</b></td>
	  <td><b>string representation</b></td>
      </tr>
	<%
	
	List<DasCoordinateSystem> coords = registry.getAllCoordinateSystems();
	Comparator dsc = DasCoordSysComparator.fromString("name");
	java.util.Collections.sort(coords,dsc);
	
	for ( int i=0; i< coords.size();i++) {
		DasCoordinateSystem cs = coords.get(i);
		if ( i%2 != 0 ) { 
		  	 %>
	    		 <tr id="row1" valign="top">
	    		 <%
		        }
		        else { 
			 %>
			 <tr id="row2"  valign="top">
			 <%
		}
		%>
		
		<td><%=cs.getName()%><%
		
		if ( (cs.getVersion() != null) && (! cs.getVersion().equals(""))){
			%>_<%=cs.getVersion()%><%
		}
		%></td>
		<td><%=cs.getCategory()%></td>
		<td><%=cs.getOrganismName()%></td>
		<td><a href="coordsys/<%=cs.getUniqueId() %>"><%=cs.toString()%></a></td>
		</tr>
		<%
	}
	%>
<%@ include file="sangertableend.jsp" %>